package com.app.xinfadi.base.status;

import android.support.annotation.StringDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

/**
 * function: 中西新增状态表
 * Created by Wutengfei on 2016/2/2.
 */
public class CenterRoleNewAddStatus {
//    S11("待审核", "01"), S12("撤回", "02"), S13("已完成", "03"), S14("部分完成", "04"), S15("未完成", "05"),
//    S21("已审批", "11"), S22("撤回", "12"), S23("已关闭", "13"),
//    S31("已下达", "21"), S32("终止", "23"), S33("不通过", "22");

    //先定义 常量
    public static final String HAVE_REPORT = "01";
    public static final String RECALL_PURCHASEMAN = "02";
    public static final String HAVE_FINISH = "03";
    public static final String HAVE_PART_FINISH = "04";
    public static final String NOT_FINISH = "05";

    public static final String WAIT_EXAMINE_APPROVE = "11";
    public static final String RECALL_CENTER_ROLE = "12";
    public static final String CLOSE = "13";

    public static final String ALREADY_ISSUED = "21";
    public static final String STOP = "23";
    public static final String NOT_GO = "22";



    // 声明构造器
    @StringDef({
            HAVE_REPORT, RECALL_PURCHASEMAN, HAVE_FINISH, HAVE_PART_FINISH, NOT_FINISH,
            WAIT_EXAMINE_APPROVE, RECALL_CENTER_ROLE, CLOSE,
            ALREADY_ISSUED, STOP, NOT_GO
    })
    @Retention(RetentionPolicy.SOURCE)
    public @interface CenterRoleNewAddStatu {
    }


    public static CenterRoleNewAddStatus sInstance;

    public static CenterRoleNewAddStatus getInstance() {
        if (sInstance == null) {
            sInstance = new CenterRoleNewAddStatus();
        }
        return sInstance;
    }
    //    限制输入字符为 PlanStatus 中的内容
//    public String getStatusName( @PlanStatus String todayCode) {

    /**
     * 限制输入字符为 PlanStatus 中的内容
     * public String getStatusName( @PlanStatus String todayCode) {
     *
     * @param statusCode
     * @return
     */
    public String getStatusName(String statusCode) {

        String name = null;
        switch (statusCode) {
            case HAVE_REPORT:
                name = "待审核";
                break;
            case RECALL_PURCHASEMAN:
                name = "撤回";
                break;
            case HAVE_FINISH:
                name = "已完成";
                break;
            case HAVE_PART_FINISH:
                name = "部分完成";
                break;
            case NOT_FINISH:
                name = "未完成";
                break;

            case WAIT_EXAMINE_APPROVE:
                name = "已审批";
                break;
            case RECALL_CENTER_ROLE:
                name = "撤回";
                break;
            case CLOSE:
                name = "已关闭";
                break;

            case ALREADY_ISSUED:
                name = "已下达";
                break;
            case STOP:
                name = "终止";
                break;
            case NOT_GO:
                name = "不通过";
                break;
            default:
                break;
        }
        return name;
    }

    private String name;
    private String statusCode;
    CenterRoleNewAddStatus() {

    }
    // 构造方法
    CenterRoleNewAddStatus(String name, String statusCode) {
        this.name = name;
        this.statusCode = statusCode;
    }


    public String getName() {
        return name;
    }

    public String getStatusCode() {
        return statusCode;
    }
}
